<?php
/**
 * @author Tr.Tuan
 * @email trantuanckc@gmail.com
 * 
 * The following variables are available in this template:
 * - $this: the BootCrudCode object
 */
?>
<div class="form">
<?php echo "<?php \$form=\$this->beginWidget('bootstrap.widgets.TbActiveForm',array(
	'id'=>'".$this->class2id($this->modelClass)."-form',
	'enableAjaxValidation'=>false,
        'method'=>'post',
	'type'=>'horizontal',
        'enableClientValidation'=>true,
        'clientOptions' => array(
                'validateOnSubmit' => true,
          ),
	'htmlOptions'=>array(
		'enctype'=>'multipart/form-data'
	)
)); ?>\n"; ?>
     	<fieldset>
		<legend>
			<p class="note"> Trường <span class="required">*</span> bắt buộc nhập.</p>
		</legend>

	
        		
   <div class="control-group">		
			<div class="span10">

<?php
foreach($this->tableSchema->columns as $column)
{
        if($column->name == 'published'){
           echo "<?php echo \$form->dropDownListRow(\$model,'published',array('1'=>'Kích hoạt', '0' => 'Khóa'),array('class' => 'span2')); ?>\n";
            continue;
        }
    
	if($column->autoIncrement)
		continue;
?>
	<?php echo "<?php echo ".$this->generateActiveRow($this->modelClass,$column)."; ?>\n"; ?>

<?php
}
?>
                        </div>   
  </div>

	<div class="form-actions">
		<?php echo "<?php \$this->widget('bootstrap.widgets.TbButton', array(
			'buttonType'=>'submit',
			'type'=>'primary',
                        'icon'=>'ok white',  
			'label'=>\$model->isNewRecord ? 'Tạo mới' : 'Cập nhật',
		)); ?>\n"; ?>
              <?php echo "<?php \$this->widget('bootstrap.widgets.TbButton', array(
			'buttonType'=>'reset',
                        'icon'=>'remove',  
			'label'=>'Reset',
		)); ?>\n"; ?>
	</div>
</fieldset>

<?php echo "<?php \$this->endWidget(); ?>\n"; ?>
<!-- seo name -->
<?php echo "<?php \$this->widget('ext.TiiSlug.TiiSlug', array(
    'model' => \$model,
    'source' => 'name',
    'target' => 'slug',
)); ?>\n"; 

?>
</div>
